package com.roundarchisobar.njariwala.netflix.controller;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.roundarchisobar.njariwala.netflix.service.impl.NetflixAuthenticationServiceImpl;

@Controller
public class HomeController {

	@Autowired
	private NetflixAuthenticationServiceImpl netflixAuthenticationServiceImpl;
	
	
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String homePageHandler(Locale locale, HttpServletRequest request, Model model) {
		Date date = new Date();
		DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);

		String formattedDate = dateFormat.format(date);

		//netflixAuthenticationServiceImpl.searchPeople("Amitabh");
		
		model.addAttribute("currentTime", formattedDate);
		return "base.definition";
	}
	
	
	
	

}
